A = imread('peppers.png');
Cshift(j,:) = fftshift(fft(B(j,:)));
imagesc(log(abs(Cshift)))
% Compute column-wise FFT
imagesc(fftshift(log(abs(D))))
D = fft2(B); % Much more efficient to use fft2
imagesc(fftshift(log(abs(D))))
Image Compression and reconstruction using FFT2
Btsort = sort(abs(Bt(:))); %sort by magnitude
for keep = [.1 .05 .01 .002] %percentage of the fft2 matrix to keep
thresh = Btsort(floor((1-keep)*length(Btsort)));
Alow = uint8(ifft2(Atlow));
title("Reconstructed from " + keep*100 + "% of the original data")